package com.qust.wj.service;

import com.qust.wj.entity.User;
import com.qust.wj.dao.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    @Autowired
    UserMapper userMapper;

    public boolean isExist(String username){
        User user =selectByUserName(username);
        return null!=user;
    }
    public User selectByUserName(String username){
        return userMapper.selectByUserName(username);
    }

    public User selectByUserNameAndPassword(User user){
        return userMapper.selectByUserNameAndPassword(user);
    }

    public int insertSelective(User user){
        return userMapper.insertSelective(user);
    }
}
